import { Link } from "react-router-dom";
import { useNavigate } from "react-router-dom";
import { useTypedDispatch } from "@store/index";
import { saveConsult } from "@store/slices/consultSlice";
import { ConsultType } from "@enums/consult";
export default function Home() {
      // 获取用于页面跳转的方法
  const navigate = useNavigate();
  // 获取 dispatch 方法
  const dispatch = useTypedDispatch();
  return (
    <div>
         <div>
        	<Link to="/fast" className={styles.item}>
      <img src={require("@icons/home/graphic.svg").default} alt="" />
      <span className={styles.title}>极速问诊</span>
      <span className={styles.sub_title}>20s医生极速回复</span>
    </Link>
    </div>
    <div
      className={styles.item}
      onClick={() => {
        dispatch(saveConsult({ type: ConsultType.Fast }));
        navigate("/fast");
      }}
    >
      <span className={styles.title}>极速问诊</span>
    </div>
    </div>
   
  
  )
import { Helmet } from "react-helmet";
import { Swiper } from "antd-mobile";
import styles from "@styles/home.module.scss";

export default function Home() {
  return (
    <>
      <Helmet>
        <title>优医问诊-首页</title>
      </Helmet>
      <div className={styles.page}>
        <div className={styles.header}>
          <span>优医</span>
        </div>
        <div className={styles.search}>
          <img src={require("@icons/home/search.svg").default} alt="" />
          <span>搜一搜：疾病/症状/医生/健康知识</span>
        </div>
        <div className={styles.ask}>
          <div className={styles.item}>
            <img src={require("@icons/home/doctor.svg").default} alt="" />
            <span className={styles.title}>问医生</span>
            <span className={styles.sub_title}>按科室查问医生</span>
          </div>
          <div className={styles.item}>
            <img src={require("@icons/home/graphic.svg").default} alt="" />
            <span className={styles.title}>极速问诊</span>
            <span className={styles.sub_title}>20s医生极速回复</span>
          </div>
          <div className={styles.item}>
            <img src={require("@icons/home/prescribe.svg").default} alt="" />
            <span className={styles.title}>开药门诊</span>
            <span className={styles.sub_title}>线上买药更方便</span>
          </div>
        </div>
        <div className={styles.mine}>
          <div className={styles.item}>
            <img src={require("@icons/home/order.svg").default} alt="" />
            <span>药品订单</span>
          </div>
          <div className={styles.item}>
            <img src={require("@icons/home/docs.svg").default} alt="" />
            <span>健康档案</span>
          </div>
          <div className={styles.item}>
            <img src={require("@icons/home/rp.svg").default} alt="" />
            <span>我的处方</span>
          </div>
          <div className={styles.item}>
            <img src={require("@icons/home/find.svg").default} alt="" />
            <span>疾病查询</span>
          </div>
        </div>
        <div className={styles.ad}>
          <Swiper
            indicatorProps={{
              color: "white",
            }}
          >
            <Swiper.Item>
              <img src={require("@images/ad.png")} alt="" />
            </Swiper.Item>
            <Swiper.Item>
              <img src={require("@images/ad.png")} alt="" />
            </Swiper.Item>
          </Swiper>
        </div>
        <div className={styles.category}>
          <span>关注</span>
          <span className={styles.active}>推荐</span>
          <span>减脂</span>
          <span>饮食</span>
        </div>
        <div className={styles.focus}>
          <div className={styles.top}>
            <h4>推荐关注</h4>
            <a href="#">查看更多 &gt;</a>
          </div>
          <div className={styles.container}>
            <div className={styles.inner}>
              <div className={styles.item}>
                <img
                  src="https://img0.baidu.com/it/u=2858914388,963166811&fm=253"
                  alt=""
                  className={styles.avatar}
                />
                <span className={styles.doctor}>王医生</span>
                <span className={styles.hospital}>积水潭医院 内分泌科</span>
                <span className={styles.job}>主任医师</span>
                <button className={styles.focus_btn}>+ 关注</button>
              </div>
              <div className={styles.item}>
                <img
                  src="https://img0.baidu.com/it/u=2858914388,963166811&fm=253"
                  alt=""
                  className={styles.avatar}
                />
                <span className={styles.doctor}>王医生</span>
                <span className={styles.hospital}>积水潭医院 内分泌科</span>
                <span className={styles.job}>主任医师</span>
                <button className={styles.focus_btn}>+ 关注</button>
              </div>
              <div className={styles.item}>
                <img
                  src="https://img0.baidu.com/it/u=2858914388,963166811&fm=253"
                  alt=""
                  className={styles.avatar}
                />
                <span className={styles.doctor}>王医生</span>
                <span className={styles.hospital}>积水潭医院 内分泌科</span>
                <span className={styles.job}>主任医师</span>
                <button className={styles.focus_btn}>+ 关注</button>
              </div>
              <div className={styles.item}>
                <img
                  src="https://img0.baidu.com/it/u=2858914388,963166811&fm=253"
                  alt=""
                  className={styles.avatar}
                />
                <span className={styles.doctor}>王医生</span>
                <span className={styles.hospital}>积水潭医院 内分泌科</span>
                <span className={styles.job}>主任医师</span>
                <button className={styles.focus_btn}>+ 关注</button>
              </div>
              <div className={styles.item}>
                <img
                  src="https://img0.baidu.com/it/u=2858914388,963166811&fm=253"
                  alt=""
                  className={styles.avatar}
                />
                <span className={styles.doctor}>王医生</span>
                <span className={styles.hospital}>积水潭医院 内分泌科</span>
                <span className={styles.job}>主任医师</span>
                <button className={styles.focus_btn}>+ 关注</button>
              </div>
              <div className={styles.item}>
                <img
                  src="https://img0.baidu.com/it/u=2858914388,963166811&fm=253"
                  alt=""
                  className={styles.avatar}
                />
                <span className={styles.doctor}>王医生</span>
                <span className={styles.hospital}>积水潭医院 内分泌科</span>
                <span className={styles.job}>主任医师</span>
                <button className={styles.focus_btn}>+ 关注</button>
              </div>
              <div className={styles.item}>
                <img
                  src="https://img0.baidu.com/it/u=2858914388,963166811&fm=253"
                  alt=""
                  className={styles.avatar}
                />
                <span className={styles.doctor}>王医生</span>
                <span className={styles.hospital}>积水潭医院 内分泌科</span>
                <span className={styles.job}>主任医师</span>
                <button className={styles.focus_btn}>+ 关注</button>
              </div>
              <div className={styles.item}>
                <img
                  src="https://img0.baidu.com/it/u=2858914388,963166811&fm=253"
                  alt=""
                  className={styles.avatar}
                />
                <span className={styles.doctor}>王医生</span>
                <span className={styles.hospital}>积水潭医院 内分泌科</span>
                <span className={styles.job}>主任医师</span>
                <button className={styles.focus_btn}>+ 关注</button>
              </div>
            </div>
          </div>
        </div>
        <div className={styles.article}>
          <div className={styles.item}>
            <div className={styles.meta}>
              <div className={styles.left}>
                <img
                  src="https://img0.baidu.com/it/u=2858914388,963166811&fm=253"
                  alt=""
                  className={styles.avatar}
                />
                <div className={styles.info}>
                  <span>王医生</span>
                  <i>积水潭医院&nbsp;皮肤科&nbsp;主任医师</i>
                </div>
              </div>
              <button className={styles.attention}>+ 关注</button>
            </div>
            <h4 className={styles.title}>炎热夏季如何防晒?</h4>
            <div className={styles.tag}># 儿童健康</div>
            <div className={styles.content}>
              炎热的夏季，那大太阳无时不刻在考验着我们的肌肤，过强、过多的阳光中紫外线的…
            </div>
            <div className={styles.container}>
              <img
                src="http://img.dxycdn.com/dotcom/2017/06/16/22/dplpfluz.jpg"
                alt=""
              />
              <img
                src="http://img.dxycdn.com/dotcom/2017/04/18/51/ncjeph7s.jpg"
                alt=""
              />
              <img
                src="http://img.dxycdn.com/dotcom/2015/11/10/16/36afs7ft.jpg"
                alt=""
              />
            </div>
            <div className={styles.footer}>
              <span>12 收藏</span>
              <span>120 评论</span>
            </div>
          </div>
          <div className={styles.item}>
            <div className={styles.meta}>
              <div className={styles.left}>
                <img
                  src="https://img0.baidu.com/it/u=2858914388,963166811&fm=253"
                  alt=""
                  className={styles.avatar}
                />
                <div className={styles.info}>
                  <span>王医生</span>
                  <i>积水潭医院&nbsp;皮肤科&nbsp;主任医师</i>
                </div>
              </div>
              <button className={styles.attention}>+ 关注</button>
            </div>
            <h4 className={styles.title}>炎热夏季如何防晒?</h4>
            <div className={styles.tag}># 儿童健康</div>
            <div className={styles.content}>
              炎热的夏季，那大太阳无时不刻在考验着我们的肌肤，过强、过多的阳光中紫外线的…
            </div>
            <div className={styles.container}>
              <img
                src="http://img.dxycdn.com/dotcom/2017/06/16/22/dplpfluz.jpg"
                alt=""
              />
              <img
                src="http://img.dxycdn.com/dotcom/2017/04/18/51/ncjeph7s.jpg"
                alt=""
              />
              <img
                src="http://img.dxycdn.com/dotcom/2015/11/10/16/36afs7ft.jpg"
                alt=""
              />
            </div>
            <div className={styles.footer}>
              <span>12 收藏</span>
              <span>120 评论</span>
            </div>
          </div>
        </div>
      </div>
    </>
  );
}